import { ALL_QUESTIONS } from '../actions/types';

const initialState = {
  questions:[],
  total:0
};

export default (state = initialState, action = {}) => {
  switch(action.type) {
    case ALL_QUESTIONS:
      return {
        questions: action.questions,
        total: action.count
      };
    default: return state;
  }
}
